package com.tanhua.server.service;

import com.alibaba.dubbo.config.annotation.Reference;
import com.tanhua.dubbo.server.api.UpdateUserLocationApi;
import com.tanhua.server.pojo.User;
import com.tanhua.server.utils.UserThreadLocal;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: Administrator
 * @date: Created in 2021/2/28 16:04
 * @version: 0.0.1
 * @modified By:
 */
@Service
public class BaiduService {

    @Reference(version = "1.0.0")
    private UpdateUserLocationApi updateUserLocationApi;

    public Boolean updateUserLocation(Double longitude,Double latitude,String address){
        try {
            User user= UserThreadLocal.get();
            this.updateUserLocationApi.updateUserLocation(user.getId(), longitude, latitude, address);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}
